<html>
<body>
<script>
    var newData = {};//computed
    var data = "哈哈哈";//data=>{}
    //核心的数据监听
    Object.defineProperty(newData,"name",{
        get(){
            console.log("获取值")
            return data;
        },
        set(Value){
            console.log("设置值",value);
            data=value;
        }
    });
    //设置值
    
    //获取值
    console.log(newData.name)
</script>
</body>
</html>